home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-08 | 6.6 KB | 220 lines | [TEXT/EMAC] |
- ;;;
- ;;; This file is part of a Macintosh port of GNU Emacs.
- ;;; Copyright (C) 1993, 1994 Marc Parmet. All rights reserved.
- ;;;
- ;;; GNU Emacs is distributed in the hope that it will be useful,
- ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ;;; GNU General Public License for more details.
- ;;;
-
- ;pascal OSErr
- ;AEDisposeDesc( AEDesc *theAEDesc )
- ; = {0x303C,0x0204,0xA816};
- (deftrap AEDisposeDesc ("303c" "0204" "a816")
- ((theAEDesc address))
- short)
-
- ;pascal OSErr
- ;AESend( const AppleEvent *theAppleEvent, AppleEvent *reply,
- ; AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks,
- ; IdleProcPtr idleProc, EventFilterProcPtr filterProc )
- ; = {0x303C,0x0D17,0xA816};
- (deftrap AESend ("303c" "0d17" "a816")
- ((theAppleEvent address)
- (reply address)
- (sendMode long)
- (sendPriority short)
- (timeOutInTicks long)
- (idleProc long)
- (filterProc long))
- short)
-
- ;pascal OSErr
- ;AECountItems( const AEDescList *theAEDescList, long *theCount )
- ; = {0x303C,0x0407,0xA816};
- (deftrap AECountItems ("303c" "0407" "a816")
- ((theAEDescList address)
- (theCount address))
- short)
-
- ;pascal OSErr
- ;AESizeOfNthItem( const AEDescList *theAEDescList, long index,
- ; DescType *typeCode, Size *dataSize )
- ; = {0x303C,0x082A,0xA816};
- (deftrap AESizeOfNthItem ("303c" "082a" "a816")
- ((theAEDescList address)
- (index long)
- (typeCode address)
- (dataSize address))
- short)
-
- ;pascal OSErr
- ;AESizeOfParam( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; DescType *typeCode, Size *dataSize )
- ; = {0x303C,0x0829,0xA816};
- (deftrap AESizeOfParam ("303c" "0829" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (typeCode address)
- (dataSize address))
- short)
-
- ; pascal OSErr
- ; AEPutParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; DescType typeCode, const void* dataPtr, Size dataSize )
- ; = {0x303C,0x0A0F,0xA816};
- (deftrap AEPutParamPtr ("303c" "0a0f" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (typeCode immediate-string)
- (dataPtr address)
- (dataSize long))
- short)
-
- ; pascal OSErr
- ; AEPutParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; const AEDesc *theAEDesc )
- ; = {0x303C,0x0610,0xA816};
- (deftrap AEPutParamDesc ("303c" "0610" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (theAEDesc address))
- short)
-
- ; pascal OSErr
- ; AEPutPtr( const AEDescList *theAEDescList, long index, DescType typeCode,
- ; const void* dataPtr, Size dataSize )
- ; = {0x303C,0x0A08,0xA816};
- (deftrap AEPutPtr ("303c" "0a08" "a816")
- ((theAEDescList address)
- (index long)
- (typeCode immediate-string)
- (dataPtr address)
- (dataSize long))
- short)
-
- ; pascal OSErr
- ; AEInstallEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
- ; EventHandlerProcPtr handler, long handlerRefcon,
- ; Boolean isSysHandler )
- ; = {0x303C,0x091F,0xA816};
- (deftrap AEInstallEventHandler-internal ("303c" "091f" "a816")
- ((theAEEventClass immediate-string)
- (theAEEventID immediate-string)
- (handler address)
- (handlerRefCon address)
- (isSysHandler short))
- short)
-
- ;;; This list is really only used now to protect the cons cells stored in the
- ;;; refCon slots of the dispatch table from being garbage collected, and for
- ;;; documentation.
- (defvar ae-callback-list nil "The list of Apple event handlers")
-
- ;;; This is called from C when receiving an Apple event registered from elisp.
- (defun ae-receive (event reply refCon)
- (funcall (car refCon) event reply (cdr refCon)))
-
- (defun AEInstallEventHandler (class type callback handlerRefCon isSysHandler)
- (let* ((callback-cons (cons callback handlerRefCon))
- (err (AEInstallEventHandler-internal class type ae-receive
- callback-cons isSysHandler)))
- (if (not (zerop err))
- err
- (setq ae-callback-list (cons (list class type callback-cons) ae-callback-list))
- noErr)))
-
- ; pascal OSErr
- ; AEGetParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; DescType desiredType, DescType *typeCode, void* dataPtr,
- ; Size maximumSize, Size *actualSize )
- ; = {0x303C,0x0E11,0xA816};
- (deftrap AEGetParamPtr ("303c" "0e11" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (desiredType immediate-string)
- (typeCode address)
- (dataPtr address)
- (maximumSize long)
- (actualSize address))
- short)
-
- ; pascal OSErr
- ; AEGetAttributePtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; DescType desiredType, DescType *typeCode, void* dataPtr,
- ; Size maximumSize, Size *actualSize )
- ; = {0x303C,0x0E15,0xA816};
- (deftrap AEGetAttributePtr ("303c" "0e15" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (desiredType immediate-string)
- (typeCode address)
- (dataPtr address)
- (maximumSize long)
- (actualSize address))
- short)
-
- ; pascal OSErr
- ; AEGetNthPtr( const AEDescList *theAEDescList, long index, DescType desiredType,
- ; AEKeyword *theAEKeyword, DescType *typeCode, void* dataPtr,
- ; Size maximumSize, Size *actualSize )
- ; = {0x303C,0x100A,0xA816};
-
- (deftrap AEGetNthPtr ("303c" "100a" "a816")
- ((theAEDescList address)
- (index long)
- (desiredType immediate-string)
- (theAEKeyword address)
- (typeCode address)
- (dataPtr address)
- (maximumSize long)
- (actualSize address))
- short)
-
- ; pascal OSErr
- ; AEGetParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
- ; DescType desiredType, AEDesc *result )
- ; = {0x303C,0x0812,0xA816};
- (deftrap AEGetParamDesc ("303c" "0812" "a816")
- ((theAppleEvent address)
- (theAEKeyword immediate-string)
- (desiredType immediate-string)
- (result address))
- short)
-
- ; pascal OSErr
- ; AECreateList( const void* factoringPtr, Size factoredSize, Boolean isRecord,
- ; AEDescList *resultList )
- ; = {0x303C,0x0706,0xA816};
- (deftrap AECreateList ("303c" "0706" "a816")
- ((factoringPtr address)
- (factoredSize long)
- (isRecord char)
- (resultList address))
- short)
-
- ; pascal OSErr
- ; AECreateDesc( DescType typeCode, const void* dataPtr, Size dataSize, AEDesc *result )
- ; = {0x303C,0x0825,0xA816};
- (deftrap AECreateDesc ("303c" "0825" "a816")
- ((typeCode immediate-string)
- (dataPtr address)
- (dataSize long)
- (result address))
- short)
-
- ; pascal OSErr
- ; AECreateAppleEvent( AEEventClass theAEEventClass, AEEventID theAEEventID,
- ; const AEAddressDesc *target, short returnID,
- ; long transactionID, AppleEvent *result )
- ; = {0x303C,0x0B14,0xA816};
- (deftrap AECreateAppleEvent ("303c" "0b14" "a816")
- ((theAEEventClass immediate-string)
- (theAEEventID immediate-string)
- (target address)
- (returnID short)
- (transactionID long)
- (result address))
- short)
-